package creationalPattern.simpleFactory;

import java.util.ArrayList;

public abstract class Pizza {
    String name;
    String dough;
    String sauce;
    ArrayList<String> toppings = new ArrayList<>();

    public String getName() {
        return name;
    }

    public void prepare() {
        System.out.println("Preparing " + name);
    }

    public void bake() {
        System.out.println("Bake " + name);
    }

    public void cut() {
        System.out.println("Cut " + name);
    }

    public void box() {
        System.out.println("Boxing " + name);
    }

    public String toString() {
        StringBuffer display = new StringBuffer();
        display.append("----" + name + "-----\n");
        display.append(dough +"\n");
        display.append(sauce +"\n");
        for (String topping :toppings) {
            display.append(topping + "\n");
        }
        return display.toString();
    }

}
